<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!--INSERT INTO wl_cust_code values(1,0,'a',null,'A','remark',0);
INSERT INTO Wl_customer  values(0,'本公司','0',null,null,null,null,null,'0','0','0','0','0','0','0',null,'0','0',0,'0',null,'0','0','1','1');-->
<title>SplitContainer Demo</title>
     <style type="text/css">
            @import "../dojo/dojo-release-1.0.0/dijit/themes/tundra/tundra.css";
            @import "../dojo/dojo-release-1.0.0/dojo/resources/dojo.css";
            @import "../dojo/dojo-release-1.0.0/dojox/grid/_grid/tundraGrid.css";
            @import "../dojo/dojo-release-1.0.0/dojox/grid/_grid/Grid.css";
            @import "../dojo/dojo-release-1.0.0/dojox/grid/_grid/Grid.css";
            @import "../js/wlProject.css";
			
      </style>
      <script type="text/javascript" src="../dojo/dojo-release-1.0.0/dojo/dojo.js"
                djConfig="parseOnLoad: true, isDebug: true,locale: 'zh-cn', extraLocale: ['zh-TW', 'fr']"></script>
      <script>
    
            dojo.require("dojo.data.ItemFileWriteStore");
            dojo.require("dijit.layout.SplitContainer");
            dojo.require("dijit.layout.ContentPane");
            dojo.require("dijit.Tree");
            dojo.require("dojo.parser");
            dojo.require("dijit._tree.dndSource");
            dojo.require("dijit.layout.TabContainer");
            dojo.require("dijit.form.Button");
            dojo.require("dojox.grid.Grid");
            dojo.require("dojox.grid._data.model");
            dojo.require("dojo.i18n");
            dojo.require("dojox.validate._base");
            dojo.require("dijit.form.ValidationTextBox");
            dojo.require("dijit.form.TextBox");
            dojo.require("dijit.form.FilteringSelect");
            dojo.require("dojox.grid._data.dijitEditors");
            
            dojo.registerModulePath("mydojo", "../../../js/mydojo");
            dojo.require("mydojo.FilteringSelect");
     </script>
        
     <script type="text/javascript" src="../js/soapclient.js"></script>
     <script type="text/javascript" src="../js/wlProject.js"></script>
     <script type="text/javascript" >


         var url = getUrl()+ "services/CodeProductManageService";
         var placedata =  new Array();
         var placedata2 =  new Array();
         // var querydata = new Array();
         var detailRows = [];
         
         var data =new Array();
         var poptarts ={ label:'name',identifier:'eId',items:data};
         var popStore = new dojo.data.ItemFileWriteStore({data: poptarts});
         
         
         var citySelectArray = new Array();
         var cityidSelectArray = new Array();
         var cityidSelectData = new Array();
         
 //按钮  
         var deletedata =new Array();
         var deletedata2 =new Array();
          //var itemt="区域";
         var identity=0;//单击的树节点ID
         var selectNode;
          
  //验证方法要放在layout前面
         var formatNotNull = function(inDatum,inRowIndex){
               return dojox.validate.isText(inDatum, {minlength: 1}) ? inDatum : "<p style={color:red}> can not is null ! </p>";
      		 }
                        
         var transplaceID = function(inDatum,inRowIndex){
                 return dojox.validate.isText(inDatum, {minlength: 1}) ? citySelectArray[inDatum] : "<p style={color:red}> can not is null ! </p>";
                  }                
          
          
          var model = new dojox.grid.data.Table(null, placedata);
          var layout =[{type: 'dojox.GridRowView', width: '20px' },{
                       
             cells: [
                      [
                       { name: '选择', width: 3, styles: 'text-align: center;', editor: dojox.grid.editors.Bool },
                       //{ name: 'no', width: 2, get: function(inRowIndex){ return inRowIndex+1;} },
                        {name: '货物分类名称', field: 2,width: 20,editor: dojox.grid.editors.Input},
                        {name: '货物分类编码', field: 3,width: 15, editor: dojox.grid.editors.Input},
                        {name: '备注', field: 4,width: 35, editor: dojox.grid.editors.Input },
                       
                       ]
                     ]
                                                                    }];
          //var model2 = new dojox.grid.data.Table(null, placedata2);
          var layout2 =[{type: 'dojox.GridRowView', width: '2px' },{
                    onBeforeRow: function(inDataIndex, inSubRows) {
                    if (inSubRows[1]!=undefined){
                        inSubRows[1].hidden = !detailRows[inDataIndex];}
                        
                },
		             cells: [
		                      [
		                       { name: '', width: 3, get: getCheck, styles: 'text-align: center;' },// +/- cell
		                       { name: '选择', width: 6,get: getDataFun, styles: 'text-align: center;', editor: dojox.grid.editors.Bool },
		                       //{ name: 'no', width: 2, get: function(inRowIndex){ return inRowIndex+1;} },
		                        {name: '货物编码', get: getDataFun,width: 15, editor: dojox.grid.editors.Input },
		                        {name: '货物名称', get: getDataFun,width: 15,editor: dojox.grid.editors.Input },
		                        {name: '规格', get: getDataFun,width: 15, editor: dojox.grid.editors.Input },
		                        {name: '型号', get: getDataFun,width: 15,editor: dojox.grid.editors.Input},
		                        {name: '计量单位', get: getDataFun,width: 5, editor: mydojo.FilteringSelect, options:["公斤", "斤", "千米","厘米"], values:["公斤", "斤", "千米","厘米"]},
		                        {name: '价格', get: getDataFun,width: 5,editor: dojox.grid.editors.Input }
		                      
	                          ],[
			                    { name: '', get: getDetail, colSpan: 8,styles: 'padding: 0; margin: 0;'}
			                  ]
	                     ]                      
                 }];                                                         
         var subGridCells = [{
                noscroll: true,
                cells: [
                         [{name: '重量',width: 10, editor: dojox.grid.editors.Input},
                          {name: '体积', width: 10,editor: dojox.grid.editors.Input},
                          {name: '标准', width: 10, editor: dojox.grid.editors.Input},
                          {name: '特殊要求',width: 10,editor: dojox.grid.editors.Input},
                          {name: '库位',width: 10, editor: dojox.grid.editors.Input },
                          {name: '备注', width: 30, editor: dojox.grid.editors.Input }
                         ]
                       ]}]; 
                           
        var subGridProps = {
                structure: subGridCells, 
                rowCount: 1, 
                autoHeight: true, 
                autoRender: false,
                "get": getDetailData
            };       
      getDetailData=function(inRowIndex) {
     var d=inRowIndex+8;
     alert("d:"+d);
     return placedata2[d];
     }
      getDataFun=function(i) {
     return placedata2[i];
     }                                                    
 // html for the +/- cell
     function getCheck(inRowIndex) { 
         var image = (detailRows[inRowIndex] ? 'open.gif' : 'closed.gif');
         var show = (detailRows[inRowIndex] ? 'false' : 'true')
         return '<img height="11" width="11" src="../image/' + image + '" onclick="toggleDetail(' + inRowIndex + ', ' + show + ')">';
     }                                                                 
// when user clicks the +/-
     
     function toggleDetail(inIndex, inShow) {
         if (!inShow) detachSubgrid(inIndex);
         detailRows[inIndex] = inShow;
         productgrid.updateRow(inIndex);
     }            
// provide html for the Detail cell in the master grid      
     function getDetail(inRowIndex) {
         var cell = this;
         // we can affect styles and content here, but we have to wait to access actual nodes
         setTimeout(function() { buildSubgrid(inRowIndex, cell); }, 1);
         // look for a subgrid
         var subGrid = dijit.byId(makeSubgridId(inRowIndex));
         var h = (subGrid ? subGrid.cacheHeight : "120") + "px";
         // insert a placeholder
         return '<div style="height: ' + h + '; background-color: white;"></div>';
     }
// render a subgrid into inCell at inRowIndex
     function buildSubgrid(inRowIndex, inCell) {
         var n = inCell.getNode(inRowIndex).firstChild;
         var id = makeSubgridId(inRowIndex);
         var subGrid = dijit.byId(id);
         if (subGrid) {
             n.appendChild(subGrid.domNode);
         } else {
             subGridProps.dataRow = inRowIndex;
             subGridProps.widgetId = id;
             subGrid = new dojox.VirtualGrid(subGridProps, n);
         }
         if (subGrid) {
             subGrid.render();
             subGrid.cacheHeight = subGrid.domNode.offsetHeight;
             inCell.grid.rowHeightChanged(inRowIndex);
         }   
     }

// identify subgrids by their row indices
    function makeSubgridId(inRowIndex) {
        return productgrid.widgetId + "_subGrid_" + inRowIndex;
    }
// if a subgrid exists at inRowIndex, detach it from the DOM
    function detachSubgrid(inRowIndex) {
        var subGrid = dijit.byId(makeSubgridId(inRowIndex));
        if (subGrid)
            dojox.grid.removeNode(subGrid.domNode);
    }    
// destroy subgrid at inRowIndex
     function destroySubgrid(inRowIndex) {
         var subGrid = dijit.byId(makeSubgridId(inRowIndex));
         if (subGrid) subGrid.destroy();
     }
        
                      	

//保存列表
                   
  addRow = function(){
          	codegrid.addRow([false,0,"","",""],codegrid.model.getRowCount());
	         	
	         } 
	addRow2 = function(){
          	productgrid.addRow([false,0,"","","","","","","","","","","",""],productgrid.model.getRowCount());
	         	
	         } 
	         
  function call_funUpd() {
   
           var s = codegrid.selection.getSelected();
           //var url = getUrl()+ "services/CodeProductManageService";
           for(var i=0;i<s.length;i++){
             var ii=s[i];
             var thisCell=codegrid.model.data[ii];
             var padd = new SOAPClientParameters2();
             var codevo=new Object();
             codevo.id=thisCell[1];
             codevo.parCode=1;
             codevo.customerID=0;
             codevo.customerName='0';
             codevo.sno='0';
             if(dojox.validate.isText(thisCell[2], {minlength: 1})){codevo.name=thisCell[2];}else{continue;}
             if(dojox.validate.isText(thisCell[3], {minlength: 1})){codevo.code=thisCell[3];}else{continue;}
             if(dojox.validate.isText(thisCell[4], {minlength: 1})){codevo.remark=thisCell[4];}else{continue;}
             if(thisCell[1]==0){//新增的记录
                padd.add('WlCustCodeVO',codevo);
                SOAPClient.invoke(url, "createCode", padd, false,  function GetEnu_callBack(ul, soapResponse){
                codegrid.model.setDatum(ul,i,1);
                });
	         }else{//修改的记录
                padd.add('WlCustCodeVO',codevo);
                SOAPClient.invoke(url, "updateCode", padd, false,  function GetEnu_callBack(ul, soapResponse){
                });
	         }
          }
//提交删除的记录？
          for(var i=0;i<deletedata.length;i++){
               var pdel = new SOAPClientParameters();      
               pdel.add('id',deletedata[i]);
               SOAPClient.invoke(url, "deleteCode", pdel, false,  function GetEnu_callBack(ul, soapResponse){
	             
	           });
          }
          codegrid.updateRow();
          deletedata=new Array();
   }
          
   function call_funUpd2() {
  
           var s = productgrid.selection.getSelected();
           //var url = getUrl()+ "services/CodeProductManageService";
           for(var i=0;i<s.length;i++){
             var ii=s[i];
             var thisCell=productgrid.model.data[ii];
             var padd = new SOAPClientParameters2();
             var productvo=new Object();
             productvo.id=thisCell[1];
             if(dojox.validate.isText(thisCell[2], {minlength: 1})){productvo.productCode=thisCell[2];//用户可自定义，用户如果不定义，则系统会自动定义为名称的首字拼音
             }else{continue;}
             if(dojox.validate.isText(thisCell[3], {minlength: 1})){productvo.equName=thisCell[3];}else{continue;}
             if(dojox.validate.isText(thisCell[4], {minlength: 1})){productvo.productType=thisCell[4];}else{continue;}
             if(dojox.validate.isText(thisCell[5], {minlength: 1})){productvo.model=thisCell[5];}else{continue;}
             if(dojox.validate.isText(thisCell[6], {minlength: 1})){productvo.unit=thisCell[6];}else{continue;}
             if(dojox.validate.isText(thisCell[7], {minlength: 1})){productvo.price=thisCell[7];}else{continue;}
             if(dojox.validate.isText(thisCell[8], {minlength: 1})){productvo.weight=thisCell[8];}else{continue;}
             if(dojox.validate.isText(thisCell[9], {minlength: 1})){productvo.volume=thisCell[9];}else{continue;}
             if(dojox.validate.isText(thisCell[10], {minlength: 1})){productvo.level=thisCell[10];}else{continue;}
             if(dojox.validate.isText(thisCell[11], {minlength: 1})){productvo.request=thisCell[11];}else{continue;}
             if(dojox.validate.isText(thisCell[12], {minlength: 1})){productvo.packID=thisCell[12];}else{continue;}
             if(dojox.validate.isText(thisCell[12], {minlength: 1})){productvo.packName=thisCell[12];}else{continue;}
             if(dojox.validate.isText(thisCell[13], {minlength: 1})){productvo.remark=thisCell[13];}else{continue;}
             codeid=0;
             codeName=0;
          if(thisCell[1]==0){//新增的记录
                padd.add('WlCustProductVO',codevo);
                SOAPClient.invoke(url, "createProduct", padd, false,  function GetEnu_callBack(ul, soapResponse){
                productgrid.model.setDatum(ul,i,1);
                });
          }else{//修改的记录
                padd.add('WlCustProductVO',codevo);
                SOAPClient.invoke(url, "updateProduct", padd, false,  function GetEnu_callBack(ul, soapResponse){
                });
             }
		  }
//提交删除的记录？
              for(var i=0;i<deletedata2.length;i++){
                   var pdel = new SOAPClientParameters();      
                   pdel.add('id',deletedata[i]);
                 SOAPClient.invoke(url, "deleteProduct", pdel, false,  function GetEnu_callBack(ul, soapResponse){
                 
                });
              }
              productgrid.updateRow();
              deletedata2=new Array();
   }
          
          
   function removeSelectedRows(){
     
           var s = codegrid.selection.getSelected();
           for(var i=0;i<s.length;i++){ 
             var ii=s[i];
             var thisCell=codegrid.model.data[ii];
             if(thisCell[1]!=0){//要删除的记录
               deletedata.splice(deletedata.length,0,thisCell[1]);
             }
           }    
           codegrid.removeSelectedRows();
    }   
 function removeSelectedRows2(){
     
           var s = productgrid.selection.getSelected();
           for(var i=0;i<s.length;i++){ 
             var ii=s[i];
             var thisCell=productgrid.model.data[ii];
             if(thisCell[1]!=0){//要删除的记录
               deletedata2.splice(deletedata2.length,0,thisCell[1]);
             }
           }    
           productgrid.removeSelectedRows();
    }    
        
          
        
           
   function init(){
         
          /* dojo.connect(endgrid, "doStartEdit", function(inCell, inRowIndex){
           
            });  
            
            //单击查询列表里的记录，可选中树中的相应节点
	       dojo.connect(endgrid, "onRowClick", function(e){
	               
	        });  
        */
           dojo.connect(productgrid, 'rowRemoved', destroySubgrid);                      
         
         
//添加分类第一层结点
                
           //var url = getUrl()+ "services/CodeProductManageService";
           var pl = new SOAPClientParameters();
           //pl.add('eType','区域') ;
           pl.add('codeID',0) ;
           pl.add('custID',0) ;
           pl.add('pageNumber',0) ;
           pl.add('pageSize',0) ;
           pl.add('orderBy',"%") ;
           SOAPClient.invoke(url, "getCodeByParCodeIDAndCustID", pl, false,  function GetEnu_callBack(ul, soapResponse){
             var pInfo = {
                   					parent: null,		
                   					attribute: "children"	
                   		};
                   		//alert(ul.length);
               for(var i = 0; i < ul.length; i++){		
                            var ulo=ul[i];
                            popStore.newItem({name: ulo["ns:name"],type:ulo["ns:parCode"] ,eId:ulo["ns:id"]}, pInfo);
                            var items = new Array();
                             items[0] = false;
                             items[1] = ulo["ns:id"];
                             items[2] = ulo["ns:name"];
                             items[3] = ulo["ns:parCode"];
                             items[4] = ulo["ns:remark"];
                             placedata[i]=items;
                       }
          });
                       
                      
//添加第二三层结点;
          var chitem;
          var chdata =new Array();
          var _tree=dijit.byId("tree");
          var childrenArray1=_tree.getChildren();
          //cityidSelectData.splice(citySelectArray.length,0,{name:'',label:'',id:0});
          for (var i=0; i<childrenArray1.length; i++){//begin	
              var p2 = new SOAPClientParameters();
              var chNode =childrenArray1[i];
              chitem=chNode.item;
              var p2Info = {	parent: chitem,		
	                    attribute: "children"	
	                 };
	      p2.add('codeID',chitem.eId);
          p2.add('custID',0) ;
          p2.add('pageNumber',0) ;
          p2.add('pageSize',0) ;
          p2.add('orderBy',"%") ;
         SOAPClient.invoke(url, "getCodeByParCodeIDAndCustID", p2 ,false,  function GetEnu_callBack(ul1, soapResponse){  
             for(var ii = 0; ii < ul1.length; ii++){	   
                              var ulo=ul1[ii];
                              var newItemCity=	popStore.newItem({name: ulo["ns:name"],type:ulo["ns:parCode"] ,eId:ulo["ns:id"]}, p2Info);
                              ///------
                                   var p3 = new SOAPClientParameters();
                                   var p3Info = {
                                                  parent: newItemCity,		
                                                  attribute: "children"	
                                                 };
                                   	p3.add('codeID',ulo["ns:id"]);
         						  	p3.add('custID',0) ;
         						  	p3.add('pageNumber',0) ;
                      				p3.add('pageSize',0) ;
                      				p3.add('orderBy',"%") ;
                                   SOAPClient.invoke(url, "getCodeByParCodeIDAndCustID", p3 ,false,  function GetEnu_callBack(ul2, soapResponse){  
                                   for(var j = 0; j < ul2.length; j++){
                                          var uloo=ul2[j];		
                                          popStore.newItem( {name: uloo["ns:name"],type:uloo["ns:parCode"] ,eId:uloo["ns:id"]}, p3Info);
                                          //citySelectArray.splice(citySelectArray.length,0,uloo["ns:placeName"]);
                                          //cityidSelectArray.splice(cityidSelectArray.length,0,uloo["ns:id"]);
                                          //cityidSelectData.splice(cityidSelectData.length,0,{name:uloo["ns:placeName"],label:uloo["ns:placeName"],id:uloo["ns:id"]});
                                   }});
                                             
                           ///----------
                 }
            });
           _tree._expandNode(chNode);
        
         }//end
         /*var placeStoreData={ label:'name',identifier:'id',items:cityidSelectData};
         var placeStore = new dojo.data.ItemFileReadStore({data: placeStoreData});
         queryend.store=placeStore;
         queryend.setValue('0');
         queryend.setDisplayedValue('');
         querystart.store=placeStore;
         querystart.setValue('0');
         querystart.setDisplayedValue('');*/
                
                
//初始化列表----begin
//初始化列表----end
            
//查询列表----begin
             dojo.connect(_tree, "onClick", function(item,node){
             //判断哪个tab在显示
             	
                    
                    selectNode=node;
                    identity = _tree.store.getIdentity(item);
                    //var url0 =getUrl()+ "services/BasicManageService";
                    var p0 = new SOAPClientParameters();
                    //alert(mainTabContainer.selectedChildWidget.id);
              if(mainTabContainer.selectedChildWidget.id=='codePane'){
                    //code
                    placedata = new Array();
                    p0.add('codeID',item["eId"]);
                    p0.add('custID',0) ;
                    p0.add('pageNumber',0) ;
      				p0.add('pageSize',0) ;
      				p0.add('orderBy',"%") ;
                    SOAPClient.invoke(url, "getCodeByParCodeIDAndCustID", p0, false,  function GetEnu_callBack(ul, soapResponse){   
                    for(var i = 0; i < ul.length; i++){		
                      var items = new Array();
                      var ulo=ul[i];
                        items[0] = false;
                        items[1] = ulo["ns:id"];
                        items[2] = ulo["ns:name"];
                        items[3] = ulo["ns:code"];
                        items[4] = ulo["ns:remark"];
                        placedata[i]=items;
                    }                
                });       
                model.setData(placedata);
                codegrid.selection.clear();
                /* var titles=node.item["name"];
                var parentNodes=node;
                while(parentNodes.getParent()!= null&& parentNodes.getParent()["id"]!="tree"){
                      parentNodes=parentNodes.getParent();
                      titles=parentNodes.item["name"]+' '+titles;
                };
                dojo.byId("placetitle").innerHTML = titles +"";*/
                deletedata =new Array();
                
             }else{
                //product
                    placedata2 = new Array();
                    p0.add('code','%');
                    p0.add('name','%');
                    p0.add('type','%');
                    p0.add('model','%');
                    p0.add('codeId',item["eId"]);
                    p0.add('pageNumber',0) ;
      				p0.add('pageSize',0) ;
      				p0.add('orderBy',"%") ;
                    SOAPClient.invoke(url, "getProductsBy", p0, false,  function GetEnu_callBack(ul, soapResponse){   
                    for(var i = 0; i < ul.length; i++){		
                      var items = new Array();
                      var ulo=ul[i];
                        items[0] = false;
                        items[1] = ulo["ns:id"];
                        items[2] = ulo["ns:productCode"];
                        items[3] = ulo["ns:equName"];
                        items[4] = ulo["ns:productType"];
                        items[5] = ulo["ns:model"];
                        items[6] = ulo["ns:unit"];
                        items[7] = ulo["ns:price"];
                        items[8] = ulo["ns:weight"];
                        items[9] = ulo["ns:volume"];
                        items[10] = ulo["ns:level"];
                        items[11] = ulo["ns:request"];
                        items[12] = ulo["ns:packName"];
                        placedata2[i]=items;
                    }                
                });       
                //model2.setData(placedata2);
                productgrid.selection.clear();
                deletedata2 =new Array();
              }  
           });  
           //查询列表----end
  }//END INIT
            
           dojo.addOnLoad(init);
           

          //查询按钮
          
          
function querybutton(){
          //根据终点树查询的范围内进行查询
              //var url =getUrl()+  "services/BasicManageService";
              var p = new SOAPClientParameters();
              var  querycodevo=new object();
                querycodevo.parCode='%';
                querycodevo.id = 0.0;
			    querycodevo.code = '%'+querycode.getDisplayedValue()+'%';
				querycodevo.customerID = 0.0;
				querycodevo.sno = '%';
				querycodevo.name = '%'+queryname.getDisplayedValue()+'%';
				querycodevo.remark = '%'+queryremark.getDisplayedValue()+'%';
              
              p.add('WlCustCodeVO',querycodevo) ;
              SOAPClient.invoke(url, "getCodeVO", p, false,  function GetEnu_callBack(ul, soapResponse){   
                     querydata=new Array();        
                     for(var i = 0; i < ul.length; i++){		
                      var items = new Array();
                      var ulo=ul[i];
                        items[0] = false;
                        items[1] = ulo["ns:id"];
                        items[2] = ulo["ns:name"];
                        items[3] = ulo["ns:code"];
                        items[4] = ulo["ns:remark"];
                      querydata[i]=items;
                    }                
                });       
                model.setData(querydata); 
         }
           
function querybutton2(){
          //根据终点树查询的范围内进行查询
              //var url =getUrl()+  "services/BasicManageService";
              var p = new SOAPClientParameters();
             // alert(queryname.getDisplayedValue()+querypostcode.getDisplayedValue()+querytype.getDisplayedValue()+queryremark.getDisplayedValue());
              p.add('code','%'+querycode2.getDisplayedValue()+'%') ;
              p.add('name','%'+queryname2.getDisplayedValue()+'%') ;
              p.add('type','%'+querytype2.getDisplayedValue()+'%') ;
              p.add('model','%'+querymodel.getDisplayedValue()+'%') ;
              p.add('codeId',0.0) ;
              SOAPClient.invoke(url, "getProductsBy", p, false,  function GetEnu_callBack(ul, soapResponse){   
                     querydata=new Array();        
                     for(var i = 0; i < ul.length; i++){		
                      var items = new Array();
                      var ulo=ul[i];
                        items[0] = false;
                         items[1] = ulo["ns:id"];
                        items[2] = ulo["ns:productCode"];
                        items[3] = ulo["ns:equName"];
                        items[4] = ulo["ns:productType"];
                        items[5] = ulo["ns:model"];
                        items[6] = ulo["ns:unit"];
                        items[7] = ulo["ns:price"];
                        items[8] = ulo["ns:weight"];
                        items[9] = ulo["ns:volume"];
                        items[10] = ulo["ns:level"];
                        items[11] = ulo["ns:request"];
                        items[12] = ulo["ns:packName"];
                      querydata[i]=items;
                    }                
                });       
                model2.setData(querydata); 
         }
           
           
           
             
</script>
</head>
<body class="tundra">
       
	
	 <div dojoType="dijit.layout.SplitContainer"   orientation="horizontal"  sizerWidth="7" activeSizing="true" 	style="border: 1px solid #bfbfbf;width: 1250px; height: 800px; align:center "  >
		
         <div dojoType="dijit.layout.ContentPane" id="treePane"  sizeMin="20" sizeShare="20"   >
                     
                <div id="tree"  class="container" dojoType="dijit.Tree" persist="false" store="popStore" labelAttr="name"  childrenAttr="children"  ></div> 
         </div>
         
        <div dojoType="dijit.layout.ContentPane" sizeMin="50" sizeShare="50"  >
        
        	<div jsId="mainTabContainer" dojoType="dijit.layout.TabContainer"  styles="width: 100%; height: 100%;"  >
        	
        	<div id="codePane" dojoType="dijit.layout.ContentPane" title="货物分类编码" >
	           		<div id="queryDiv" style="margin-right: 30px; width:100%; height: 23%; display:none;" >
	                        <table align="center" width=86% class="queryTable"  >
	                        <tr height="3" ></tr>
						          <tr align="center"><td >请输入查询条件：</td><td></td></tr> <tr height="6" ></tr>
						          <tr align="center" >
						               <td>货物分类名称：<input type="text" jsId="queryname"   dojoType="dijit.form.TextBox"  /></td>
						               <td>货物分类编码：<input type="text" jsId="querycode"   dojoType="dijit.form.TextBox"  /></td>
						          </tr><tr height="6" ></tr>
						          <tr align="center" >
	                                   <td colspan="2" >备注：<input type="text" jsId="queryremark"   dojoType="dijit.form.TextBox"  /></td>
	                               </tr>    
	                       <tr height="3" ></tr>
	                       <tr align="center"><td></td><td ><a onclick="querybutton();"><img src="../image/332.gif" height="20" width="20" border="0">确 定</a></td></tr> <tr height="6" ></tr>
						    </table>
	            </div>
	          	<div align="right">
	          		<a onclick="querydisplay();"><img src="../image/332.gif" height="20" width="20" border="0">查询</a>
			        <a onclick="addRow();"><img src="../image/371.gif" height="20" width="20" border="0">新 增</a>
			        <a onclick="removeSelectedRows();"><img src="../image/808.gif" height="20" width="20" border="0">删 除</a>
			        <a onclick="call_funUpd();"><img src="../image/334.gif" height="20" width="20" border="0">保 存</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
			     </div>   
	        
	         <div  style="{ width:100%; height: 1%; }" > </div>
	         <div id="codegrid"  dojoType="dojox.Grid"  autoWidth="false" style="{width:100%;height:85%}" 	jsId="codegrid"	model="model" structure="Layout" singleClickEdit="true"  ></div>
	      </div>

          <div id="productPane" dojoType="dijit.layout.ContentPane" title="货物编码"  selected="true" >
	           		
	             	<div id="queryDiv2" style="margin-right: 30px; width:100%; height: 23%; display:none;" >
	                        <table align="center" width=86% class="queryTable"  >
	                        <tr height="3" ></tr>
						          <tr align="center"><td >请输入查询条件：</td><td></td></tr> <tr height="6" ></tr>
						          <tr align="center" >
						               <td>货物编码：<input type="text" jsId="querycode2"  dojoType="dijit.form.TextBox"  /></td>
						               <td>货物名称：<input type="text"  jsId="queryname2"   dojoType="dijit.form.TextBox"  /></td>
						          </tr><tr height="6" ></tr>
						          <tr align="center" >
						               <td>规格：<input type="text" jsId="querytype2"   dojoType="dijit.form.TextBox"  /></td>
						               <td>型号：<input type="text" jsId="querymodel"   dojoType="dijit.form.TextBox"  /></td>
						          </tr><!-- tr height="6" ></tr>
						          <tr align="center" >
						               <td>计量单位：<input type="text" jsId="queryunit"   dojoType="dijit.form.TextBox"  /></td>
						               <td>价格：<input type="text" jsId="queryprice"   dojoType="dijit.form.TextBox"  /></td>
						          </tr><tr height="6" ></tr>
						          <tr align="center" >
						               <td>重量：<input type="text" jsId="queryweight"   dojoType="dijit.form.TextBox"  /></td>
						               <td>体积：<input type="text" jsId="queryvolume"   dojoType="dijit.form.TextBox"  /></td>
						          </tr><tr height="6" ></tr>
						          <tr align="center" >
						               <td>标准：<input type="text" jsId="querylevel"   dojoType="dijit.form.TextBox"  /></td>
						               <td>特殊要求：<input type="text" jsId="queryrequest"   dojoType="dijit.form.TextBox"  /></td>
						          </tr><tr height="6" ></tr>
						          <tr align="center" >
						               <td>库位：<input type="text" jsId="querypack"   dojoType="dijit.form.TextBox"  /></td>
						               <td>备注：<input type="text" jsId="queryremark"   dojoType="dijit.form.TextBox"  /></td-->
						   <tr height="3" ></tr>
	                       <tr align="center"><td></td><td ><a onclick="querybutton();"><img src="../image/332.gif" height="20" width="20" border="0">确 定</a></td></tr> <tr height="6" ></tr>
						    </table>
	            </div>
	          	<div align="right">
	          		<a onclick="querydisplay('queryDiv2');"><img src="../image/332.gif" height="20" width="20" border="0">查询</a>
			        <a onclick="addRow2();"><img src="../image/371.gif" height="20" width="20" border="0">新 增</a>
			        <a onclick="removeSelectedRows2();"><img src="../image/808.gif" height="20" width="20" border="0">删 除</a>
			        <a onclick="call_funUpd2();"><img src="../image/334.gif" height="20" width="20" border="0">保 存</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
			     </div>   
	        
	         <div  style="{ width:100%; height: 1%; }" > </div>
	         
	    
	         <div id="productgrid"  dojoType="dojox.VirtualGrid"  autoWidth="false" style="{width:100%;height:85%}" jsId="productgrid"	 structure="layout2" singleClickEdit="true"  ></div>
	      </div>
      </div> 
       </div>  
 </div>
</body></html>
